package com.itmeima.service.impl;

import com.itmeima.bean.Manager;
import com.itmeima.dao.ManagerDao;
import com.itmeima.dao.impl.ManagerDaoImpl;
import com.itmeima.service.ManagerService;

import java.util.ArrayList;

public class ManagerServiceImpl implements ManagerService {
    //判断是否登录成功
    @Override
    public boolean login(String id, String name) {
        ManagerDao managerDao = new ManagerDaoImpl();
        ArrayList<Manager> manList = managerDao.getList();
        for (Manager manager : manList) {
            if (id.equals(manager.getId())&&name.equals(manager.getName())){
                //id和name一致才登陆成功，返回true
                    return true;
            }
        }
        return false;
    }
}
